package org.cybergarage.upnp.event;

import java.util.Vector;

import org.cybergarage.net.HostInterface;
import org.cybergarage.upnp.ControlPoint;

public class SubscriptionMUServerList extends Vector <SubscriptionMUServer>{


	//todo:1
	public boolean open(){
		int nHostAddrs = HostInterface.getNHostAddresses();
		for(int n=0; n<nHostAddrs; n++){
			String bindAddr = HostInterface.getHostAddress(n);
			SubscriptionMUServer server= new SubscriptionMUServer(bindAddr);
			add(server);
		}
		
		
		
		return true;
	}
	
	public void setControlPoint(ControlPoint ctrl){
		int nSockets = size();
		for(int n=0; n<nSockets; n++){
			SubscriptionMUServer server = (SubscriptionMUServer)get(n);
			server.setControlPoint(ctrl);
		}
	}
	
	public void start(){
		int nSockets = size();
		for(int n=0; n<nSockets; n++){
			SubscriptionMUServer server = (SubscriptionMUServer)get(n);
			server.start();
		}
	}
	
}
